﻿Imports Microsoft.VisualBasic
'Library To Connect To Database
Imports System.Data.SqlClient


Public Class Data

    Shared Conn As New SqlConnection()

    Public Shared Function OpenDatabase() As SqlConnection

        If Conn.State = System.Data.ConnectionState.Closed Then

            Conn.ConnectionString = "Server=aaroneof\sqlexpress;Database=Shop;Trusted_Connection=True;"
            Conn.Open()

        End If

        Return Conn

    End Function

    Public Shared Sub CloseDatabase()

        Conn.Close()

    End Sub

End Class
